package com.taotao.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;

import com.taotao.common.pojo.EUImageUpload;
import com.taotao.service.PictureService;
import com.taotao.utils.JsonUtils;

@Controller
public class ImageUploadController {
	
	@Autowired
	private PictureService picService;
	
//	@RequestMapping(value="/pic/upload")
//	@ResponseBody
//	public EUImageUpload upload(MultipartFile uploadFile) {
//		EUImageUpload result = picService.uploadPic(uploadFile);
//		return result;
//	}
	
	@RequestMapping(value="/pic/upload")
	@ResponseBody
	public String upload(MultipartFile uploadFile) {
		EUImageUpload result = picService.uploadPic(uploadFile);
		return JsonUtils.objectToJson(result);
	}
	
	
}
